package cn.wongshu.student.controller;

import cn.wongshu.student.pojo.Message;
import cn.wongshu.student.pojo.Reply;
import cn.wongshu.student.pojo.Result;
import cn.wongshu.student.pojo.StatusCode;
import cn.wongshu.student.service.ReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/reply")
public class ReplyController {


    @Autowired
    private ReplyService replyService;

    @GetMapping("/findByCommentId/{id}")
    public Result findReplyListBycommentId(@PathVariable("id") Integer id){
        List<Reply> replyList = replyService.findByCommentId(id);
        return new Result(true, StatusCode.Ok,Message.SELECT_SUCCESS,replyList);


    }

}
